package com.jelly.web.share.userInfo;

import com.jelly.common.constant.MessageConstant;
import com.jelly.web.modules.message.service.IMessageService;
import com.jelly.web.share.base.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @创建人 ql
 * @创建时间 2018-10-24 15:33
 * @项目名称 jelly
 * @功能描述: 消息控制器
 **/
@Controller
@RequestMapping("/share/msg")
public class MessageController extends BaseController {

    @Autowired
    private IMessageService messageService;

    /**
     * 首页未读消息
     * @param model
     * @return
     */
    @GetMapping
    String getMsg(Model model){

        //获取字典详情
        getDictionary();
        //当前用户的未读消息
        model.addAttribute("msg",messageService.getMessageAllRead(MessageConstant.READNO));

        return adminUserInfor("/msg");
    }


}
